home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / snpd1292.zip / REBOOT.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  508b  |  33 lines

  1. /*
  2. **  Public domain demo to reboot a PC
  3. */
  4.  
  5. #ifdef __TURBOC__
  6.  #define FAR far
  7. #else
  8.  #define FAR _far
  9. #endif
  10.  
  11. short FAR *bios_post = (short FAR *)0x00400072;
  12. void (FAR * boot)(void) = (void (FAR *)())0xffff0000;
  13.  
  14. void reboot(warm)
  15. {
  16.       if (warm)
  17.             *bios_post = 0x1234;
  18.       else  *bios_post = 0;
  19.       boot();
  20. }
  21.  
  22. #ifdef TEST
  23.  
  24. #include <stdio.h>
  25.  
  26. void main(void)
  27. {
  28.       puts("The computer should do a cold start");
  29.       reboot(0);
  30. }
  31.  
  32. #endif /* TEST */
  33.